home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / mactool / xlib101.cpt / xLibrary 1.0.1 / xLibrary Installer / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1992-09-16  |  6.2 KB  |  29 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>6</cardCount>
  7.     <cardID>7752</cardID>
  8.     <listID>5139</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><true /></cantDelete>
  11.     <cantAbort><true /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on openStack
  17. global Connections, Terminals, ActiveWindow, CloseRequest
  18.  
  19. if RegistrationDialog(1131) < 0 then
  20. go "Home"
  21. else
  22. put CTBInitialise() into CTBTools
  23. if CTBTools < 0 then
  24. go "Home"
  25. else
  26. set cursor to watch
  27. put line 1 of CTBTools into Connections
  28. put line 2 of CTBTools into Terminals
  29. modifyMenubar
  30. put empty into ActiveWindow
  31. put empty into CloseRequest
  32. visual effect dissolve fast
  33. go to card "Menu"
  34. end if
  35. end if
  36. end openStack
  37.  
  38. on closeStack
  39. set cursor to watch
  40. checkStackSize
  41. reset menubar
  42. end closeStack
  43.  
  44. on suspendStack
  45. set cursor to watch
  46. checkForLiveService
  47. closeBackground
  48. reset menubar
  49. end suspendStack
  50.  
  51. on resumeStack
  52. set cursor to watch
  53. modifyMenubar
  54. openBackground
  55. end resumeStack
  56.  
  57. on idle
  58. global CloseRequest
  59. if CloseRequest <> empty then
  60. CloseService CloseRequest
  61. put empty into CloseRequest
  62. end if
  63. pass Idle
  64. end Idle
  65.  
  66. on doMenu ItemID, MenuID
  67. if ItemID = "Print Service Details" then
  68. print card
  69. exit doMenu
  70. end if
  71.  
  72. if ItemID = "Print Script" then
  73. print background field "Script"
  74. exit doMenu
  75. end if
  76.  
  77. if ItemId = "Rebuild Service List" then
  78. set lockmessages to true
  79. lock screen
  80. sort cards of background "Service" by bkgnd field "Service"
  81. go to the first card of background "Service"
  82. put id of last card of background "Service" into LastCard
  83. put 0 into LineCount
  84. put empty into fld "Services" in card "Menu"
  85. repeat
  86. set cursor to busy
  87. put the short name of this card into Temp
  88. put Temp into bkgnd field "Service"
  89. add 1 to LineCount
  90. put Temp into line Linecount of fld "Services" in card "Menu"
  91. if id of this card = LastCard then exit repeat
  92. go to next card of background "Service"
  93. end repeat
  94. go to card "Menu"
  95. unlock screen
  96. set lockmessages to false
  97. end if
  98.  
  99. pass doMenu
  100. end doMenu
  101.  
  102. on checkForLiveService
  103. Global ActiveWindow
  104. if ActiveWindow <> empty then
  105. closeService ActiveWindow
  106. end if
  107. end checkForLiveService
  108.  
  109. on startService
  110. if the heapspace < 200000 then
  111. beep
  112. answer "Memory is running low and there may be insufficient remaining to Test this service." & return & return & ┬¼
  113. "(If the service fails to launch then more memory may be made available by reconfiguring HyperCard with more initial memory)." & return & " " ┬¼
  114. with "Abort Launch" or "Continue"
  115. if it = "Abort Launch" then exit to HyperCard
  116. end if
  117. set the highlite of background button "Help" to false
  118. hide bkgnd field "Help"
  119. put bkgnd field "Password" into Password
  120. if Password <> empty then
  121. ask password clear "This service is password protected." & return & "Enter the correct password :"
  122. if the Result = "Cancel" then
  123. exit startService
  124. end if
  125. if it <> Password then
  126. beep
  127. answer "Invalid password !!" with "Continue"
  128. exit startService
  129. end if
  130. end if
  131. put TestWindow(0, bkgnd field "Service", 1) into Ptr
  132. if Ptr > 0 then
  133. if bkgnd field "Connection" <> empty then hide menubar
  134. if OpenService(Ptr, true) = 0 then
  135. disable menu  "Function"
  136. else
  137. send "Delete" to window bkgnd field "Service"
  138. end if
  139. show menubar
  140. end if
  141. end startService
  142.  
  143. on closeService Service
  144. if CloseWindow("CloseNamed", Service, true) <> -1 then
  145. send "Delete" to window Service
  146. end if
  147. enable menu  "Function"
  148. end closeService
  149.  
  150. on modifyMenubar
  151. hide message
  152. set blindTyping to false
  153. choose browse tool
  154. set userlevel to 2
  155. delete menuitem "Print Field..."  of menu "File"
  156. delete menuitem "Print card"      of menu "File"
  157. delete menuitem "Print Stack..."  of menu "File"
  158. delete menuitem "Print Report..." of menu "File"
  159. put "Print Service Details,Print Script,-,Rebuild Service List" after menuitem "Page Setup..." in menu "File"
  160. disable menuitem "Print Service Details" of menu "File"
  161. disable menuitem "Print Script"          of menu "File"
  162. disable menuitem "Rebuild Service List"  of menu "File"
  163. put "Undo,-,Cut,Copy,Paste,Clear" into menu "Edit"
  164. disable menuitem "Undo" in menu "Edit"
  165. set the commandChar of menuitem "Cut"   of menu "Edit" to "X"
  166. set the commandChar of menuitem "Paste" of menu "Edit" to "V"
  167. set the commandChar of menuitem "Copy"  of menu "Edit" to "C"
  168. disable menu "Edit"
  169. end modifyMenubar
  170.  
  171. on updateServiceNames OldServiceName, NewServiceName
  172. Global ServiceMenu
  173.  
  174. set cursor to busy
  175. put fld "Services" in card "Menu" into Temp
  176. put the number of lines in Temp into LineNo
  177. if OldServiceName <> empty then
  178. repeat with i = 1 to LineNo
  179. if line i of Temp = OldServicename then
  180. if NewServicename = empty then
  181. delete line i of Temp
  182. else
  183. put NewServiceName into line i of Temp
  184. end if
  185. sort lines of Temp ascending
  186. put Temp into fld "Services" in card "Menu"
  187. exit updateServiceNames
  188. end if
  189. end repeat
  190. end if
  191. add 1 to LineNo
  192. put NewServiceName into line LineNo of Temp
  193. sort lines of Temp ascending
  194. put Temp into fld "Services" in card "Menu"
  195. end updateServiceNames
  196.  
  197. on checkStackSize
  198. put 10 into Percent
  199. get the size of stack
  200. put (it/100)*Percent into Margin
  201. get the freesize of stack
  202. put it into SlackBytes
  203. if SlackBytes > Margin then doMenu "Compact Stack"
  204. end checkStackSize
  205.  
  206. on displayHelp Text
  207. if visible of bkgnd field "Help" is true then put Text into bkgnd field "Help"
  208. end displayHelp
  209. </script>
  210.     <background id="2570" file="background_2570.xml" name="New Service" />
  211.     <background id="3593" file="background_3593.xml" name="Menu" />
  212.     <background id="4379" file="background_4379.xml" name="Script" />
  213.     <background id="6067" file="background_6067.xml" name="Banner" />
  214.     <background id="10650" file="background_10650.xml" name="Service" />
  215.     <card id="7752" file="card_7752.xml" marked="false" name="Banner" owner="6067" />
  216.     <card id="11475" file="card_11475.xml" marked="false" name="Menu" owner="3593" />
  217.     <card id="4252" file="card_4252.xml" marked="false" name="Script" owner="4379" />
  218.     <card id="8075" file="card_8075.xml" marked="false" name="New Service" owner="2570" />
  219.     <card id="5787" file="card_5787.xml" marked="false" name="Example Service #1" owner="10650" />
  220.     <card id="8573" file="card_8573.xml" marked="false" name="Example Service #2" owner="10650" />
  221. </stack>
  222.